import App from './App'
import Vue from 'vue'

// uview-ui
import uView from 'uview-ui';
Vue.use(uView);

// uview-ui 导航栏
import cuCustom from '@/components/custom/custom.vue'
Vue.component('cuCustom', cuCustom)

//引入接口请求
import api from '@/common/config/api.js'
Vue.prototype.$http = api.http
Vue.prototype.$host = api.hostImg
Vue.prototype.$shareImg = api.shareImg

//引入common文件
import common from '@/common/config/common.js'
Vue.prototype.$comm = common

//引入vuex
import store from '@/store/store.js'


// 引入配置文件
import $C from './common/config.js';
Vue.prototype.$C = $C

// 挂在助手函数库
import $U from './common/util.js';

// 引入请求库
import $H from './common/request.js';
Vue.prototype.$H = $H


//封装原生 toast 提示
Vue.prototype.$toast = (content,time = 3000) => {
	uni.showToast({
		icon: 'none',
		title: content,
		duration: time
	})
}

//H5复制到剪切板
import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)

// 上拉加载、下拉刷新
import MescrollBody from './components/mescroll-uni/mescroll-body.vue'
Vue.component('mescroll-body', MescrollBody)

//全局过滤器
import * as Filter from './common/filters/filters'
// 导出的是对象，可以直接通过 key 和 value 来获得过滤器的名和过滤器的方法
Object.keys(Filter).forEach(key => {
  Vue.filter(key, Filter[key])
})

//路由跳转
Vue.prototype.$routerGo = (obj)=> {
	uni.navigateTo({
		url: obj
	})
}

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    ...App,
	store
})
app.$mount()